Parallel and sequential in-place permuting and perfect shuffling using involutions

نویسندگان

  • Qingxuan Yang
  • John A. Ellis
  • Khalegh Mamakani
  • Frank Ruskey
چکیده

Every permutation of {1, 2, . . . , N} can be written as the product of two involutions. As a consequence, any permutation of the elements of an array can be performed in-place using simultaneous swaps in two rounds of swaps. In the case where the permutation is the k-way perfect shuffle we develop two methods for efficiently computing the pair of involutions that accomplishes these swaps. The first method works whenever N is a power of k; in this case the time is O(N) and space O(log N). The second method applies to the general case where N is a multiple of k; here the time is O(N logN) and the space is O(log N). If k = 2 the space usage of the first method can be reduced to O(logN) on a machine that has a SADD (population count) instruction. keywords: Perfect shuffle, merging, sorting, permutation, involution.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

In-place permuting and perfect shuffling using involutions

Every permutation of {1, 2, . . . , N} can be written as the product of two involutions. As a consequence, any permutation of the elements of an array can be performed in-place using simultaneous swaps in two rounds of swaps. In the case where the permutation is the k-way perfect shuffle we develop two methods for efficiently computing the pair of involutions that accomplishes these swaps. The ...

متن کامل

موازی سازی شبیه سازی پدیده ناپایداری دوجریانی به روش PIC

Two stream instability in plasma is simulated by PIC method. The execution time of the sequential and parallizable sections of the program is measured. The sequential program is parallelized with the help of the MPI functions. Then, the execution time of the sequential program versus the number of the grid points and the execution time of the parallel program on 3 and 5 processors versus the nu...

متن کامل

Juggling and Card Shuffling Meet Mathematical Fonts

We explore two of Ron Graham’s passions—juggling patterns and perfect card shuffling— through one of our passions, mathematical fonts. First, for each letter of the English alphabet, we design a one-person three-ball juggling pattern where the balls trace out the letter (possibly rotated 90◦). Second, using a deck of 26 cards labeled A through Z, we show how to perform a sequence of in/out perf...

متن کامل

Parallel Generation of t-ary Trees

A parallel algorithm for generating t-ary tree sequences in reverse B-order is presented. The algorithm generates t-ary trees by 0-1 sequences, and each 0-1 sequences is generated in constant average time O(1). The algorithm is executed on a CREW SM SIMD model, and is adaptive and cost-optimal. Prior to the discussion of the parallel algorithm a new sequential generation with O(1) average time ...

متن کامل

A distributed-memory approximation algorithm for maximum weight perfect bipartite matching

We design and implement an efficient parallel approximation algorithm for the problem of maximum weight perfect matching in bipartite graphs, i.e. the problem of finding a set of non-adjacent edges that covers all vertices and has maximum weight. This problem differs from the maximum weight matching problem, for which scalable approximation algorithms are known. It is primarily motivated by fin...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره abs/1204.1958  شماره 

صفحات  -

تاریخ انتشار 2012